package com._520it._03_many2one_one2many.mapper;

import com._520it._03_many2one_one2many.domain.Department;
import org.apache.ibatis.annotations.Param;

import java.util.List;


public interface DepartmentMapper {

    void save(Department department);

    void delete(Long id);

    Department getDepartmentById(Long  empId);


    //==========one2many=======================
    //额外SQL
    Department get(Long id);


    //内连接方式
    Department get1(Long id);

    //根据many方id的变化, one方来维护many方的关系, 也就是设置many方的外键信息
    void updateRelation(@Param("deptId") Long deptId, @Param("empId") long empId);

    List<Department> list();
}
